﻿using UnityEngine;
using System.Collections;

namespace DevelopTools.UI
{
    /// <summary>
    /// UI动画播放
    /// </summary>
    public class UIAnimation : MonoBehaviour
    {
        public bool isLoop = true;
        /// <summary>
        /// UI速度
        /// </summary>
        [HideInInspector]
        public float speed;
        /// <summary>
        /// 正常速度
        /// </summary>
        public float normalSpeed = 10;
        /// <summary>
        /// 加速的倍数
        /// </summary>
        public float multipleSpeed = 10;
        //初始调用
        public virtual void Awake()
        {

        }

        // 开始调用
        public virtual void Start()
        {
            Init();
        }

        // 每帧调用
        public virtual void Update()
        {

        }
        //结束时
        public virtual void OnDestroy()
        {

        }
        public virtual void Init()
        {
            speed = normalSpeed;
        }
        /// <summary>
        /// 开始播放
        /// </summary>
        public virtual void PlayAnimation()
        {

        }
        /// <summary>
        /// 停止播放
        /// </summary>
        public virtual void StopAnimation()
        {

        }

        /// <summary>
        /// 加速播放
        /// </summary>
        public virtual void SetFast()
        {
            speed = normalSpeed * multipleSpeed;
        }
        /// <summary>
        /// 原速播放
        /// </summary>
        public virtual void SetNomal()
        {
            speed = normalSpeed;
        }



    }

}